<?php
namespace app\home\model;
use \think\Model;
use \think\Db;

class LoginModel extends Model{
    public function query($data){
        $rows = Db::table('users')->where($data)->find();
        return $rows;
    }
    public function phone($phone){
        $rows = Db::table('users')->where('phone',$phone)->find();
        return $rows;
    }
    public function weixinLogin($openId){
        $rows = Db::table('users')->where('open_id',$openId)->find();
        return $rows;
    }
    public function reg($insert){
        $rows=Db::table('users')->insert($insert);
        return $rows;
    }
    public function modify($data){
        $rows=Db::table('users')->update($data);
        return $rows;
    }
}